<%-- 
    Document   : CadastroTurma
    Created on : 01/12/2011, 20:45:45
    Author     : Rennan
--%>

<%@page import="br.com.ufpb.halloc.negocio.Disciplina"%>
<%@page import="br.com.ufpb.halloc.negocio.Curso"%>
<%@page import="java.util.List"%>
<%@page import="br.com.ufpb.halloc.comunicacao.Facade"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Cadastro Turma</title>
        <style type="text/css">
            div#back {
                background-color: lightsteelblue;
                height: 320px;
                margin-top: 20px;
                margin-left: 170px;
                margin-right: 170px;
            }
            div#form{
                background-color: #DDD;
                font: 14px Verdana, sans-serif;
                height: 200px;
                margin-top: 5px;
                border: 0px solid #696969;
                margin-left: 150px;
                margin-right: 150px;
            }
            
            div#campos, div#form {
                color: #333;
            }
            
            div#combo_disc{
                margin-left: 10px;
            }
            
            div#combo{
                margin-left: 600px;
            }
            
            div#campos, div#tab_inputs tr{                
                font: 16px Verdana, sans-serif;
                color: #369;
                font-weight: bolder;                
            }
            
            select {
                font: 16px Verdana, sans-serif;
                color: #369;
                font-weight: bolder;
            }
            
            #campos select {
                width:400px;
                height: 30px;
                opacity:1;
                filter:alpha(opacity=0);
                margin-left: 100px;
            }
            
            .icod, .icarga, .icred {
                width: 100px;
                height: 20px;
                font: 16px Verdana, sans-serif;
                color: #333;
                font-weight: bolder;
            }
            
            .inome {
                width: 350px;
                height: 20px;
                font: 16px Verdana, sans-serif;
                color: #333;
                font-weight: bolder;
            }
            
        </style>
    </head>
    <body>
        <jsp:include page="menubarra.jsp"></jsp:include>
        <form method="POST" action="CadastroTurma.do">
            <div id="back">
                <br>
                <div align="center">Cadastro de Turma</div>
                <h3 align="center">${mensagem}</h3>             
                <div id="form">
                    <div id="campos">
                        <br>
                        <select name="curso">    
                            <% Facade fachada = Facade.getInstance();
                                List<Curso> cursos = fachada.getCursos();
                                for (Curso c : cursos) {
                            %>
                            <option  value="<%=c.getID()%>" id="<%=c.getID()%>"><%=c.getNome()%></option>

                            <% }%>     
                        </select>
                        <br>
                        <br>                                
                        <select name="disciplina">    
                            <% Facade fac = Facade.getInstance();
                                List<Disciplina> disciplinas = fac.getDisciplinasCadastradasNoBD();
                                for (Disciplina d : disciplinas) {
                            %>
                            <option  value="<%=d.getID()%>" id="<%=d.getID()%>"><%=d.getNome()%></option>

                            <% }%>     
                        </select>
                            <br> 
                            <br>
                        <table id="tab_inputs" width="90%" align="center">                            
                            <tr>
                                <td>Código:</td>
                                <td><input class="icod" type="text" name="cod_turma" size="10"></td>
                            </tr>
                            <tr>
                                <td>Nome: </td>
                                <td><input class="inome" type="text" name="nome_turma" size="40"></td>
                            </tr>
                        </table>
                    </div>     
                </div> <br>           
                <center>
                    <input type="submit" value="Cadastrar">
                </center>
                <br>
            </div>
        </form>
    </body>
</html>
